#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int main()
{
	int n = 0;
	int sum = 0;
	for (n = 0; n < 10000; n++)
	{
		sum += n;
		if (sum > 7000)
		{
			break;
		}
	}
	printf("%d\n", n);
	printf("%d\n", sum);

	return 0;
}